<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no" />
		<title>锦尚中国</title>
		<link rel="stylesheet" type="text/css" href="../../css/aui.css" />
	 
	 	<style>
	 		.a1{
	 			position: relative;	 		
	 			background: url('../../image/yaoqing/yaoqingmaBy.jpg') no-repeat;
	 			background-size:100% 100%;
	 			height: 100%;
	 			width: 100%;
	 			padding: 0;
	 			margin: 0;
	 		}
	 		.a1 img{
	 			width: 100%;
	 			height: 100%;
	 		}
	 		.a2{
	 			width: 80%;
	 			margin: 0 auto;
	 			padding-top: 40%;
	 			color: #fff
	 		}
	 		.a2 p{
	 			text-align: center;
	 			color: #fff;
	 			font-size: 0.65rem;
	 			padding-bottom: 1rem;
	 			 
	 		}
	 		.a2 input{
	 			border-radius: 2rem;
	 			background: #fff;
	 			padding: 0 1rem;
	 			font-size: 0.75rem;
	 			color: #212121;
	 			box-shadow: 0px 0px 20px 1px #bdbdbd
	 		}
	 		.a3{
	 			width: 100%;
	 			margin-bottom: 0.75rem;
	 		}
	 		.a4{
	 			width:60%;
	 			border-radius: 2rem;
	 			color: #fff;
	 			font-size: 0.8rem;
	 			background: #CE1C10;
	 			padding: 0.35rem 0rem;
	 			text-align: center;
	 			font-weight: bold;
	 			margin: 0 auto;
	 			margin-top: 0.75rem;	
	 			box-shadow: 0px 0px 20px 1px #9b4a4a;		
	 		}
	 	</style>
	</head>
	<body>
		<div class="a1">
			<div class="a2">
				<p style="font-weight: bold; font-size:0.8rem;">输入好友邀请码您可以领取红包</p>
				<input type="tel" placeholder="输入邀请码" onkeyup="value=value.replace(/[^\d]/g,'')"  />
				<div class="a3">
					<div class="a4" onclick="ajax()">拆红包</div>
				</div>
				<p>向您的好友 / 推荐人询问邀请码</p>
			</div>
		</div>
	</body>
 
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/ffxiang.js"></script>
	<script type="text/javascript">
		apiready = function() {
			$api.css($api.dom('.a1'),'height:'+api.winHeight+'px')
			api.parseTapmode();
		}
		function ajax(){
			var yaoqingma=$api.val($api.dom('.a2 input'));
			if(!yaoqingma){
				_msg('请输入邀请码');
				return;
			}
			if(yaoqingma == _user.id){
				_msg('不能自己当师傅哦');
				return;
			}
			_loading();
			_ajax('api/yaoqing/yaoqingma',function(ret,err){
				_loadingCloes()
				if(ret){
					if(ret.ret){
						_alert(ret.ret,function(ret){
							_close()
						})
					}else{
						_msg(ret.err);
					}
				}else{
					_alert(JSON.stringify(err))
				}
			},{yaoqingma:yaoqingma})
		}
			
	
	</script>
</html>